Skip to content

refactor(firestore): pipeline native gap analysis remediation#9086

Merged
mikehardy merged 20 commits into
mainfrom
pipeline-continue-workqueue
Jul 6, 2026
Merged

refactor(firestore): pipeline native gap analysis remediation#9086
mikehardy merged 20 commits into
mainfrom
pipeline-continue-workqueue

Conversation

@mikehardy

@mikehardy mikehardy commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Description

Firestore Pipelines native gap analysis remediation — platform parity (Phase J), coverage expansion (K–Q), and pre-merge full-harness validation (Phase R). Tracker: pipeline coverage work queue.

Bugs found & fixed

  • iOS stage option coercion — unnest empty indexField, findNearest non-field distanceField expressions, and limit/offset numeric validation now match Android (coerceStageOptionFieldName; defer limit/offset to bridge factory).
  • Android ↔ iOS bridge parity (J1–J6) — operand coercion, integerLiteral lowering, stage option expression fields, constant envelope routing, timestampTruncate arity.
  • iOS stage coercion & operand tail (N) — stage coercion and arithmetic operand lowering aligned with Android review feedback.
  • Android coverage upload — repair Detox/Jacoco pull path for native coverage in CI.

Coverage (Phase A baseline → Phase R full tier)

E2e: macOS 698/0 · iOS 838/0 · Android 866/0 passing (full harness, no narrowing).

Target Phase A Phase R Delta
TS pipeline_runtime.ts 86% 91.07% (204/224) +5.07 pp
TS expressions.ts 89% 93.98% (250/266) +4.98 pp
TS pipeline_validate.ts ~93% 88.64% (78/88) −4.36 pp (e2e lcov vs Jest mix)
Android NodeBuilder 67.5% 75.18% (1324/1761) +7.68 pp
Android Executor ~49–58% 76.59% (386/504) +18.6–27.6 pp
iOS NodeBuilder 68.89% 69.10% (1516/2194) +0.21 pp
Android EnterObject loop 106 missed 65 missed (71.98%) −41 missed
iOS operand modes (L919–1006) 27 missed 17 missed (72.58%) −10 missed

Also: −238 lines dead Android Executor code removed (Phase Q intractability audit); compare-types 19/19 documented; Jest 1146/1146 green.

Related issues

Release Summary

Firestore Pipelines: Android and iOS native bridge parity fixes, expanded pipeline e2e and TS/native coverage, dead-code removal in Android Executor lowering.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/**/e2e
    • jest tests added or updated in packages/**/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

  • Phase R full-tier 3-platform :test-cover (698 / 838 / 866 passing)
  • yarn compare:types — firestore + firestore-pipelines documented
  • yarn tests:jest — 1146 tests
  • yarn tsc:compile, yarn tsc:compile:consumer, yarn reference:api
  • yarn lint:js, yarn lint:android, yarn lint:ios:check

@mikehardy

Copy link
Copy Markdown
Collaborator Author

Currently stuck on a tough queue item, these are pretty chewy problems (or they wouldn't have happened in the first place!) so it still has a little ways to go.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses critical platform parity gaps between Android and iOS for Firestore Pipelines. It implements several remediation phases focused on operand coercion, constant lowering, and expression handling, while simultaneously expanding test coverage for pipeline runtime and expression logic. These changes ensure consistent behavior across platforms and improve the robustness of the pipeline parser and executor.

Highlights

  • Platform Parity: Remediated Android-iOS bridge gaps including operand coercion, integer literal lowering, and stage option expression fields.
  • Expression Lowering: Implemented support for exit-frame and receiver-chain expression lowering on Android to ensure parity with iOS.
  • Coverage Expansion: Expanded pipeline e2e and TypeScript runtime coverage, including new tests for parsed-aggregate expression arguments.
  • Parser Refinement: Updated the parser to handle constant envelope routing and added strict arity validation for timestamp truncation.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request aligns the Android Firestore pipeline implementation with iOS, resolving several bridge parity gaps (P-005 through P-012). Key updates include parsing and coercing stage option fields (like distanceField and indexField) as expressions, implementing strict arity validation for timestampTruncate, and introducing ExpressionCoercionMode to handle numeric and comparison operand coercion (such as converting booleans to 0/1 for arithmetic). The changes are accompanied by comprehensive unit and e2e tests. The review feedback correctly identifies two high-severity issues in ReactNativeFirebaseFirestorePipelineNodeBuilder.java: first, numeric operand coercion is incorrectly restricted to arguments after the first index in arithmetic functions; second, nested constant maps containing booleans bypass coercion because the boolean check is performed before resolving the constant value.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.63492% with 74 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.95%. Comparing base (6ff817e) to head (a860457).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9086      +/-   ##
============================================
+ Coverage     57.38%   57.95%   +0.57%     
- Complexity     1529     1563      +34     
============================================
  Files           503      503              
  Lines         38490    38574      +84     
  Branches       5666     5655      -11     
============================================
+ Hits          22085    22352     +267     
+ Misses        15025    14778     -247     
- Partials       1380     1444      +64     
Flag Coverage Δ
android-native 52.66% <55.56%> (+1.34%) ⬆️
e2e-ts-android 49.48% <55.56%> (+0.85%) ⬆️
e2e-ts-ios 53.62% <74.25%> (+0.19%) ⬆️
e2e-ts-macos 41.47% <90.39%> (+0.26%) ⬆️
ios-native 53.62% <74.25%> (+0.19%) ⬆️
jest 48.38% <75.37%> (+0.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mikehardy mikehardy force-pushed the pipeline-continue-workqueue branch from 98efacc to 4da576e Compare July 3, 2026 23:41
@mikehardy mikehardy marked this pull request as ready for review July 3, 2026 23:41
@cursor

cursor Bot commented Jul 3, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

mikehardy added 17 commits July 6, 2026 07:23
Add seven targeted e2e probes for live Android Executor coerce and
validation branches; Jacoco 58%→60.94%. Remaining missed lines skew
dead-code — defer to Phase Q.
Cover remaining pipeline_validate.ts branch guards via direct Jest
calls; 100% line coverage. Unreachable validateSource default-param
branch deferred to Phase Q audit.
…code

Delete uncalled readableMap helpers, applyPrimitiveRawOptions, and
applyUnionStage paths superseded by buildNativePipeline; document
remaining intractable coverage caps in the work queue.
Unnest/findNearest use coerceStageOptionFieldName; defer limit/offset
numeric validation to bridge factory so Phase R native executor e2e passes.
Record 3-platform full-tier green after iOS stage option coercion fix.
Update snapshot table with iOS NodeBuilder 69.10% and operand-mode delta.
mikehardy added 3 commits July 6, 2026 07:23
Record Phase A→R deltas for eventual PR 9086 comment; queue static pre-merge checks.
Static pre-merge validation green; branch ready for PR 9086 push.
@mikehardy mikehardy force-pushed the pipeline-continue-workqueue branch from 4da576e to a860457 Compare July 6, 2026 12:23
@cursor

cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for this team, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@mikehardy mikehardy merged commit 855a6fc into main Jul 6, 2026
22 checks passed
@mikehardy mikehardy deleted the pipeline-continue-workqueue branch July 6, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants